<h1>The Anatomy of a Trongate Module</h1>
<p>A Trongate module is typically organized into three primary directories, each serving a distinct purpose:</p>
<ul>
    <li><strong>Controllers:</strong> This directory contains the business logic of the module. It typically includes one or more PHP files, with at least one file defining a PHP class. While most modules contain a single PHP class file, some may require multiple files depending on complexity.</li>
    <li><strong>Views:</strong> The views directory houses presentational content, primarily HTML. These PHP files are designed to integrate seamlessly with HTML, focusing on the user interface rather than business logic. This directory is optional, as not all modules produce presentational output.</li>
    <li><strong>Assets:</strong> This directory stores additional resources such as CSS, JavaScript, images, and configuration files for API endpoints. Like the views directory, this is optional and only included when necessary.</li>
</ul>
<div class="text-center">
    <figure>
        <img src="images/65/trongate7MEL.png" alt="The basic structure of a typical Trongate module" style="width:100%">
        <figcaption>The basic structure of a typical Trongate module.</figcaption>
    </figure>
</div>
<div class="alert alert-info">
    <h3>What About the 'Models' Directory?</h3>
    <p>To facilitate secure and efficient database interactions, all Trongate modules can utilize a centralized 'Model' PHP class. This class resides within the Trongate framework's 'engine' directory, rather than within individual modules. Centralizing the model simplifies maintenance, enhances security, and ensures consistent database interactions across all modules.</p>
    <p>For more information regarding Trongate's <a href="documentation-ref/list_refs/class_reference/the-model-class">Model class</a>, please refer to the <a href="documentation/display/php_framework/database-operations">Database Operations</a> chapter.</p>
</div>